package com.jn.erp.web.api.student.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@TableName("t_student_course")
@NoArgsConstructor
public class StudentCourse extends TStudentCourse{

  private static final long serialVersionUID=1L;

  @TableId(value = "id", type = IdType.AUTO)
  private Long id;

  /**
   * 报名老师所属组织ID
   */
  private Long orgId;

  /**
   * 订单编号
   */
  private String orderNo;

  /**
   * 退订订单编号
   */
  private String orderNoRefund;

  /**
   * 订单类型1新报名2续保3退课
   */
  private Integer type;

  /**
   * 学生id
   */
  private Long studentId;

  /**
   * 课程d
   */
  private Long courseId;

  /**
   * 定价标准id
   */
  private Integer priceId;

  /**
   * 科目id
   */
  private Long subjectId;

  /**
   * 开始时间
   */
  private LocalDate startDate;

  /**
   * 过期日期
   */
  private LocalDate expireDate;

  /**
   * 购买总课次(全部)
   */
  @Excel(name ="总购买数量")
  private Integer countLessonTotal;

  /**
   * 购买总课次(正常)
   */
  private Integer countLessonTotalNormal;

  /**
   * 购买总课次(赠送)
   */
  @Excel(name ="赠送数量")
  private Integer countLessonTotalGive;

  /**
   * 已上课次
   */
  @Excel(name ="已消耗数量")
  private Integer countLessonComplete;

  /**
   * 退款次数
   */
  @Excel(name ="退转数量")
  private Integer countLessonRefund;

  /**
   * 总价
   */
  @Excel(name ="总价")
  private BigDecimal courseAmount;

  /**
   * 折扣价
   */
  private BigDecimal discountAmount;

  /**
   * 原单价--学生课消使用
   */

  private BigDecimal originalUnitPrice;

  /**
   * 单价
   */
  @Excel(name ="单价")
  private BigDecimal unitPrice;

  /**
   * 成交/合约金额（退款金额）
   */
  @Excel(name ="应收金额")
  private BigDecimal amount;

  /**
   * 实付金额（实退金额）
   */
  @Excel(name ="实付金额")
  private BigDecimal paidAmount;

  /**
   * 状态0未支付，1已支付
   */
  private Integer state;

  /**
   * 订单来源
   */
  private Long source;

  /**
   * 支付方式
   */
  private Long payType;

  /**
   * 经手人
   */
  private Long operator;

  /**
   * 经办日期
   */
  private String handlingTime;

  /**
   * 审核状态
   */
  private Integer verifyState;

  /**
   * 不足时已提醒次数
   */
  private Integer warningTimes;

  /**
   * 赠送课时
   */
//  @Excel(name ="赠送数量")
//  private Integer freeClassHours;

  /**
   * 结课状态 0是1否
   */
  private Integer exhausted;

  /**
   *结课来源 1清零，2结课，3转历史 4过期
   */
  private Integer exhaustedType;

  /**
   * 停复状态0停课1复课
   */
  private Integer stopsResume;

  /**
   * 备注
   */
  private String remark;

  /**
   * 创建人
   */
  @Excel(name ="创建人")
  private Long creator;

  /**
   * 录入时间
   */
  @Excel(name ="添加时间")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime addTime;

  /**
   * 编辑人
   */
  private Long editor;

  /**
   * 编辑时间
   */
  private LocalDateTime editTime;

  /**
   * 删除标记
   */
  private Integer deleted;


  @TableField(exist = false)
  private Integer remainderLessonGive;



  public StudentCourse(Long orgId, String orderNo, String orderNoRefund, Integer type, Long studentId, Long courseId, Integer priceId, Long subjectId, LocalDate startDate, LocalDate expireDate, Integer countLessonTotal, Integer countLessonTotalNormal, Integer countLessonTotalGive, Integer countLessonComplete, Integer countLessonRefund, BigDecimal courseAmount, BigDecimal discountAmount, BigDecimal originalUnitPrice, BigDecimal unitPrice, BigDecimal amount, BigDecimal paidAmount, Integer state, Long source, Long payType, Long operator, Integer verifyState, Integer warningTimes, Integer exhausted, String remark, Long creator, LocalDateTime addTime, Long editor, LocalDateTime editTime, Integer deleted) {
    this.orgId = orgId;
    this.orderNo = orderNo;
    this.orderNoRefund = orderNoRefund;
    this.type = type;
    this.studentId = studentId;
    this.courseId = courseId;
    this.priceId = priceId;
    this.subjectId = subjectId;
    this.startDate = startDate;
    this.expireDate = expireDate;
    this.countLessonTotal = countLessonTotal;
    this.countLessonTotalNormal = countLessonTotalNormal;
    this.countLessonTotalGive = countLessonTotalGive;
    this.countLessonComplete = countLessonComplete;
    this.countLessonRefund = countLessonRefund;
    this.courseAmount = courseAmount;
    this.discountAmount = discountAmount;
    this.originalUnitPrice = originalUnitPrice;
    this.unitPrice = unitPrice;
    this.amount = amount;
    this.paidAmount = paidAmount;
    this.state = state;
    this.source = source;
    this.payType = payType;
    this.operator = operator;
    this.verifyState = verifyState;
    this.warningTimes = warningTimes;
    this.exhausted = exhausted;
    this.remark = remark;
    this.creator = creator;
    this.addTime = addTime;
    this.editor = editor;
    this.editTime = editTime;
    this.deleted = deleted;
  }


}

